/*    */ package my.rummyInterface;
/*    */ 
/*    */ import java.awt.Color;
/*    */ import java.awt.Dimension;
/*    */ import java.awt.Font;
/*    */ import java.awt.GridLayout;
/*    */ import java.awt.event.ActionEvent;
/*    */ import java.awt.event.ActionListener;
/*    */ import javax.swing.BorderFactory;
/*    */ import javax.swing.JButton;
/*    */ import javax.swing.JOptionPane;
/*    */ import javax.swing.JPanel;
/*    */ import javax.swing.JTextField;
/*    */ import javax.swing.border.TitledBorder;
/*    */ 
/*    */ public class PanelRonda extends JPanel
/*    */   implements ActionListener
/*    */ {
/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
/* 28 */   public static String DEFINIR = "DEFINIR";
/*    */   private RummyInterface principal;
/*    */   private JTextField txtNumero;
/*    */   private JButton btnDefinir;
/*    */ 
/*    */   public PanelRonda(RummyInterface principalP)
/*    */   {
/* 41 */     this.principal = principalP;
/*    */ 
/* 44 */     TitledBorder borde = BorderFactory.createTitledBorder("Numero de Ronda");
/* 45 */     borde.setTitleColor(Color.BLUE);
/* 46 */     borde.setTitleFont(new Font("Arial", 1, 12));
/* 47 */     borde.setTitleJustification(2);
/* 48 */     borde.setBorder(BorderFactory.createEmptyBorder());
/* 49 */     setBorder(borde);
/*    */ 
/* 52 */     setLayout(new GridLayout(1, 3));
/*    */ 
/* 55 */     this.txtNumero = new JTextField("");
/* 56 */     this.txtNumero.addActionListener(this);
/* 57 */     this.txtNumero.setActionCommand(DEFINIR);
/* 58 */     this.txtNumero.setPreferredSize(new Dimension(45, 0));
/* 59 */     add(this.txtNumero);
/*    */ 
/* 61 */     this.btnDefinir = new JButton("Ronda");
/* 62 */     this.btnDefinir.addActionListener(this);
/* 63 */     this.btnDefinir.setActionCommand(DEFINIR);
/* 64 */     add(this.btnDefinir);
/*    */   }
/*    */ 
/*    */   public void actionPerformed(ActionEvent e)
/*    */   {
/* 72 */     String comando = e.getActionCommand();
/* 73 */     String nombre = this.txtNumero.getText();
/* 74 */     this.txtNumero.setBackground(new Color(244, 244, 244));
/* 75 */     if (comando.equals(DEFINIR))
/*    */     {
/*    */       try
/*    */       {
/* 79 */         this.principal.definirRonda(nombre);
/*    */       }
/*    */       catch (Exception ex)
/*    */       {
/* 83 */         JOptionPane.showMessageDialog(this, "No puede estar en Blanco el espacio", "Rummy", 0);
/*    */       }
/*    */     }
/*    */   }
/*    */ }

/* Location:           C:\Users\Yank\Documents\APO\Rummy\bin\
 * Qualified Name:     my.rummyInterface.PanelRonda
 * JD-Core Version:    0.6.0
 */